<?php

namespace partner\functions\wechat\lib\SaleInfo;

use partner\functions\wechat\lib\BaseWechatPartner;
use Exception;

class AppInfo extends BaseWechatPartner
{
    protected $upload_properties = [
        'app_pics'
    ];

    // 服务商应用APPID
    public $app_appid = '';

    // 商家应用APPID
    public $app_sub_appid = '';

    // APP截图
    public $app_pics = [];

    public function setAppAppId(string $app_appid = "")
    {
        $this->app_appid = $app_appid;
        return $this;
    }

    public function setAppSubAppId(string $app_sub_appid = "")
    {
        $this->app_sub_appid = $app_sub_appid;
        return $this;
    }

    public function setAppPics(array $app_pics = [])
    {
        if (empty($app_pics))
            throw new Exception("APP截图不能为空");

        $this->app_pics = $app_pics;
        return $this;
    }
}